package gui2.g4;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

public class ChatListCellRenderer implements ListCellRenderer{

	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		
		JLabel l = new JLabel();
		
		l.setText(value.toString());
		if(((ChatMessage)value).getUsername().equals("Admin")){

			l.setForeground(Color.RED);
		}
		
		return l;
	}

}
